home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 2
/
Gekikoh Dennoh Club Vol. 2 (Japan).7z
/
Gekikoh Dennoh Club Vol. 2 (Japan) (Track 01).bin
/
kowin
/
util
/
timer11s.lzh
/
dateget.s
< prev
next >
Wrap
Text File
|
1991-08-05
|
3KB
|
182 lines
*
* 日付/時間ライブラリ 曜日なし
*
* 1990 11/11 by 小笠原博之
* SPS0783 COR.
*
include iocscall.mac
include doscall.mac
.xdef _date_get
.xdef _time_get
.xdef _date_get2
.xdef _time_get2
.xdef _alarmflag
.xdef _timerflag
.xdef _signalflag
.xdef _alarmtime
.xdef _timertime
.xdef _alarmevent
.xdef _sigmode
.xdef _alm
.text
*////////////////////////////////////////////////////////
*
* void date_get( char *buf, int mode );
*
if 1
_date_get:
IOCS _DATEGET
bra.s dateget
_date_get2:
IOCS _DATEGET
cmp.l datebuf(pc),d0
beq exit_0
move.l d0,datebuf
dateget:
move.l d0,d1
move.l 4(sp),a1
move.l 8(sp),a2
IOCS _DATEBIN
move.l d0,d1
rol.l #4,d1
* moveq.l #0,d2
* move.b d1,d2 * day -> d2
and.b #$f0,d1
move.l a2,d0
or.b d0,d1
ror.l #4,d1
IOCS _DATEASC
bra exit_1
datebuf:
dc.l 0
endif
timebuf:
dc.l 0
*////////////////////////////////////////////////////////
*////////////////////////////////////////////////////////
*
* void time_get( char *buf );
*
_time_get:
IOCS _TIMEGET
bra.s timeget
_time_get2:
IOCS _TIMEGET
cmp.l timebuf(pc),d0
beq exit_0
timeget:
move.l d0,timebuf
moveq.l #1,d2
tst.l _signalflag
beq skipsig
cmp.w #$5957,d0
bne.s skip2
moveq.l #2,d2
bra.s skipsig
skip2:
cmp.w #$5958,d0
bne.s skip3
moveq.l #2,d2
bra.s skipsig
skip3:
cmp.w #$5959,d0
bne.s skip4
moveq.l #2,d2
bra.s skipsig
skip4:
tst.w d0
bne.s skipsig
moveq.l #4,d2
skipsig:
move.l d0,d1
move.l 4(sp),a1
move.l a1,a2
IOCS _TIMEBIN
tst.l _sigmode
beq.s sigmusi
moveq.l #1,d2
move.l d0,d1
and.w #$ff00,d1
bne.s sigmusi
swap d1
tst.b d1
bne.s nosig1
move.b #12,d1
nosig1:
cmp.b #13,d1
bcs.s nosig2
sub.b #12,d1
nosig2:
cmp.b d1,d0
bcc.s sigmusi
moveq.l #5,d2
sigmusi:
move.l d0,d1
IOCS _TIMEASC
cmp.b #' ',(a2)
bne.s jumpden
move.b #'0',(a2)
jumpden:
tst.l _alarmflag
beq chktimer2
move.l _alarmtime(pc),d0
cmp.l timebuf(pc),d0
bne.s chktimer
alarmdenden:
clr.l _alarmevent
clr.l _alm
bra.s exit_3
chktimer:
clr.b d0
move.l timebuf(pc),d1
clr.b d1
cmp.l d0,d1
bne.s alarmdededen
tst.l _alarmevent
bne alarmdenden
bra chktimer2
alarmdededen:
move.b #1,_alarmevent
chktimer2:
tst.l _timerflag
beq.s exit_2
move.l _timertime(pc),d0
cmp.l timebuf(pc),d0
bne.s exit_2
clr.l _timerflag
move.l #1,_alm
exit_3:
moveq.l #3,d0
rts
exit_2:
move.l d2,d0
rts
exit_1:
moveq.l #1,d0
rts
exit_0:
moveq.l #0,d0
rts
_alarmflag:
dc.l 0
_timerflag:
dc.l 0
_signalflag:
dc.l 0
_alarmtime:
dc.l 0
_timertime:
dc.l 0
_alarmevent:
dc.l 1
_alm:
dc.l 0
_sigmode:
dc.l 0